package com.gzhryc.net_marketing.cloud.business.dao.db;

import java.util.Date;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.annotaion.UniqueKey;
import com.gzhryc.net_marketing.cloud.business.dao.enums.MarketProjectAppEnum;

/**
 * 商品供应商
 */
@Table(name="market_supplier")
public class MarketSupplier {
	
	@Id(autoIncrement = 50000)
    @Column(notNull = true)
    protected Long id;

    @Column(notNull = true,note="供应商名称")
    protected String name;
    
    @UniqueKey
    @Column(name = "user_id",notNull = true,note = "供应商用户ID")
    protected Long userId;
    
    @Column(name = "user_name",notNull = true,note = "供应商用户姓名")
    protected String userName;
    
    @Column(name = "user_phone",notNull = true,note = "供应商用户手机号")
    protected String userPhone;
    
    @UniqueKey
	@Column(name="account_id",notNull = true,note="云支付账号ID")
    protected Long accountId;

    @Column(name="service_charge_ratio",notNull = true,note = "服务费比例")
    protected Double serviceChargeRatio;
    
    @Column(name = "db_config", length = 1024, note = "数据库配置")
    protected String dbConfig;
    
    @Column(name="state",notNull = true,defVal = "1",note="状态")
    protected Integer state;
    
    @Column(name="last_login_date",note = "最后登录时间")
    protected Date lastLoginDate;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}
	
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserPhone() {
		return userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	public Long getAccountId() {
		return accountId;
	}

	public void setAccountId(Long accountId) {
		this.accountId = accountId;
	}

	public Double getServiceChargeRatio() {
		return serviceChargeRatio;
	}

	public void setServiceChargeRatio(Double serviceChargeRatio) {
		this.serviceChargeRatio = serviceChargeRatio;
	}

	public String getDbConfig() {
		return dbConfig;
	}

	public void setDbConfig(String dbConfig) {
		this.dbConfig = dbConfig;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getLastLoginDate() {
		return lastLoginDate;
	}

	public void setLastLoginDate(Date lastLoginDate) {
		this.lastLoginDate = lastLoginDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	public String getStateName(){
        return MarketProjectAppEnum.State.note(this.state);
    }
}
